<?

class QVarDumper extends CVarDumper{
    
    function init(){
        
    }
    
    function d($var, $depth=10){
        return parent::dump($var, $depth, true);
    }
    
}

function debug($var, $depth=10){
    return QVarDumper::d($var, $depth);
}

function substr_word($text, $counttext = 10, $sep = ' ') {
    $words = explode($sep, $text);
    if ( count($words) > $counttext )
        $text = implode($sep, array_slice($words, 0, $counttext));
    return $text;
}
